﻿<%@ Page Title="Redhouse - Nhà đỏ" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Home.aspx.cs" Inherits="RedHouse.Web.Home" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<% if (Session["location"].ToString() == "1")
   { %>
    <script type="text/javascript">
	$(document).ready(function() {
		$('#slider').nivoSlider({
			effect:"fade",
			slices:5,
			boxCols:8,
			boxRows:4,
			animSpeed:500,
			pauseTime:6000,
			startSlide:0,
			directionNav:false,
			directionNavHide:true,
			controlNav:true,
			controlNavThumbs:true,
			controlNavThumbsFromRel:true,
			keyboardNav:true,
			pauseOnHover:false,
			manualAdvance:false,
			afterLoad: function(){
				$('.nivo-controlNav').wrap('<div class="nivo-controlNav_wrap"></div>');
				$('.nivo-controlNav_wrap').before('<div class="nivo-controlNav_left"></div>');
				$('.nivo-controlNav_wrap').after('<div class="nivo-controlNav_right"></div>');
			},
			afterChange: function(){
				if ($(".nivo-control[rel='0']").hasClass("active")) {$('.nivo-controlNav a').animate({left:"0px"},500);}
				else if ($(".nivo-control[rel='1']").hasClass("active")) {$('.nivo-controlNav a').animate({left:"0px"},500);}
				else if ($(".nivo-control[rel='2']").hasClass("active")) {$('.nivo-controlNav a').animate({left:"0px"},500);}
				else if ($(".nivo-control[rel='3']").hasClass("active")) {$('.nivo-controlNav a').animate({left:"-243px"},500);}
				//else if ($(".nivo-control[rel='4']").hasClass("active")) {$('.nivo-controlNav a').animate({left:"-486px"},500);}
				//else if ($(".nivo-control[rel='5']").hasClass("active")) {$('.nivo-controlNav a').animate({left:"-486px"},500);}
			},
			slideshowEnd: function(){
				$('.nivo-controlNav a').animate({left:"0px"},1000);
			},
		});
		
		$("#hidden-link").click(function() {
			var address = "index.html";
            window.location = address;
		});
		
		$("#top-left, #top-right").find("a").hover(function() {
			if (!$(this).hasClass("selected")) {
				var currSrc = $(this).find("img").attr("src");
				var nextSrc = currSrc.split('.');
				var newSrc = nextSrc[0] + "-hover" + ".png";
				$(this).find("img").attr("src", newSrc);
			}
		}, function() {
			if (!$(this).hasClass("selected")) {
				var currSrc = $(this).find("img").attr("src");
				var nextSrc = currSrc.split('-');
				var newSrc = nextSrc[0] + ".png";
				$(this).find("img").attr("src", newSrc);
			}
		});
		
		$('.nivo-controlNav_right').click(function(){
			var pos=Number($('.nivo-controlNav a').css("left").replace("px",""));
			if (pos>-486) {$('.nivo-controlNav a').animate({left:"-=243px"},250, function(){$('.nivo-controlNav a').clearQueue();} );}
		});

		$('.nivo-controlNav_left').click(function(){
			var pos=Number($('.nivo-controlNav a').css("left").replace("px",""));
			if (pos<-242){$('.nivo-controlNav a').animate({left:"+=243px"},250, function(){$('.nivo-controlNav a').clearQueue();} );}
		});
	});

    function redirectToSpecialties()
    {
        parent.location = "DishList.aspx?page=Specialties";
    }
    
    function redirectToMenu() {
        parent.location = "Menu.aspx";
    }
    </script>
<%
   } %>
<% else
   { %>
   <script type="text/javascript">
	$(document).ready(function() {
		$('#slider').nivoSlider({
			effect:"fade",
			slices:5,
			boxCols:8,
			boxRows:4,
			animSpeed:500,
			pauseTime:6000,
			startSlide:0,
			directionNav:false,
			directionNavHide:true,
			controlNav:true,
			controlNavThumbs:true,
			controlNavThumbsFromRel:true,
			keyboardNav:true,
			pauseOnHover:false,
			manualAdvance:false,
			afterLoad: function(){
				$('.nivo-controlNav').wrap('<div class="nivo-controlNav_wrap"></div>');
				$('.nivo-controlNav_wrap').before('<div class="nivo-controlNav_left"></div>');
				$('.nivo-controlNav_wrap').after('<div class="nivo-controlNav_right"></div>');
			},
			afterChange: function(){
				if ($(".nivo-control[rel='0']").hasClass("active")) {$('.nivo-controlNav a').animate({left:"0px"},500);}
				else if ($(".nivo-control[rel='1']").hasClass("active")) {$('.nivo-controlNav a').animate({left:"0px"},500);}
				else if ($(".nivo-control[rel='2']").hasClass("active")) {$('.nivo-controlNav a').animate({left:"0px"},500);}
				//else if ($(".nivo-control[rel='3']").hasClass("active")) {$('.nivo-controlNav a').animate({left:"-243px"},500);}
				//else if ($(".nivo-control[rel='4']").hasClass("active")) {$('.nivo-controlNav a').animate({left:"-486px"},500);}
				//else if ($(".nivo-control[rel='5']").hasClass("active")) {$('.nivo-controlNav a').animate({left:"-486px"},500);}
			},
			slideshowEnd: function(){
				$('.nivo-controlNav a').animate({left:"0px"},1000);
			},
		});
		
		$("#hidden-link").click(function() {
			var address = "index.html";
            window.location = address;
		});
		
		$("#top-left, #top-right").find("a").hover(function() {
			if (!$(this).hasClass("selected")) {
				var currSrc = $(this).find("img").attr("src");
				var nextSrc = currSrc.split('.');
				var newSrc = nextSrc[0] + "-hover" + ".png";
				$(this).find("img").attr("src", newSrc);
			}
		}, function() {
			if (!$(this).hasClass("selected")) {
				var currSrc = $(this).find("img").attr("src");
				var nextSrc = currSrc.split('-');
				var newSrc = nextSrc[0] + ".png";
				$(this).find("img").attr("src", newSrc);
			}
		});
		
		$('.nivo-controlNav_right').click(function(){
			var pos=Number($('.nivo-controlNav a').css("left").replace("px",""));
			if (pos>-486) {$('.nivo-controlNav a').animate({left:"-=243px"},250, function(){$('.nivo-controlNav a').clearQueue();} );}
		});

		$('.nivo-controlNav_left').click(function(){
			var pos=Number($('.nivo-controlNav a').css("left").replace("px",""));
			if (pos<-242){$('.nivo-controlNav a').animate({left:"+=243px"},250, function(){$('.nivo-controlNav a').clearQueue();} );}
		});
	});

    function redirectToSpecialties()
    {
        parent.location = "DishList.aspx?page=Specialties";
    }
    
    function redirectToMenu() {
        parent.location = "Menu.aspx";
    }
    </script>
<%
   } %>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <% if (Session["location"].ToString() == "1")
       { %>
        <div id="slider" class="nivoSlider">
            <%--<img class="home-slide" src="http://redhouse.com.vn/picture_library/promotion/xmas.jpg" rel="picture_library/promotion/xmas-thumb.jpg" title="#cap7" />--%>
            <%--<img class="home-slide" src="http://redhouse.com.vn/picture_library/promotion/dauhu.jpg" rel="picture_library/promotion/dauhu-thumb.jpg" title="#cap6" />--%>
            <img class="home-slide" src="https://lh4.googleusercontent.com/-oOEIBIed9PY/TwZ3ew_iJbI/AAAAAAAAACQ/-1ikQPEr1AU/s580/580x520.jpg" rel="https://lh5.googleusercontent.com/-2_tWrTVjjJk/TwscqkbbzhI/AAAAAAAAADg/d8wcRj2NvMM/s231/231x215.jpg" title="#cap9" />
            <img class="home-slide" src="http://redhouse.com.vn/picture_library/cua_xot_ot/2.jpg" rel="images/home-1_thumb.png" title="#cap1" />
            <img class="home-slide" src="http://redhouse.com.vn/picture_library/cua_xot_tieu_den/3.jpg" rel="images/home-2_thumb.png" title="#cap2" />
            <img class="home-slide" src="http://redhouse.com.vn/picture_library/oc_mong_tay/3.jpg" rel="images/home-3_thumb.png" title="#cap3" />
            <img class="home-slide" src="http://redhouse.com.vn/picture_library/dau_hu_tay_cam/1.jpg" rel="images/home-4_thumb.png" title="#cap4" />
        </div>

        <div id="cap9" class="nivo-html-caption">
            <%=RedHouse.Web.Resources.lblHomeTitle9 %>
            <br />
            <hr />
            <%=RedHouse.Web.Resources.lblHomeCaption9 %>
            <hr />
            <br />
            <button class="button btn-cart">
                <a href="DishList.aspx?page=Specialties"><span><span>Specialties</span></span></a></button>
            &nbsp;&nbsp;&nbsp;
            <button class="button btn-cart">
                <a href="Menu.aspx"><span><span>Menu</span></span></a></button>
        </div>

        <%--<div id="cap6" class="nivo-html-caption">
            <%=RedHouse.Web.Resources.lblHomeTitle6 %>
            <br />
            <hr />
            <%=RedHouse.Web.Resources.lblHomeCaption6 %>
            <hr />
            <br />
            <button class="button btn-cart">
                <a href="DishList.aspx?page=Specialties"><span><span>Specialties</span></span></a></button>
            &nbsp;&nbsp;&nbsp;
            <button class="button btn-cart">
                <a href="Menu.aspx"><span><span>Menu</span></span></a></button>
        </div>--%>

        <div id="cap1" class="nivo-html-caption">
            <%=RedHouse.Web.Resources.lblHomeTitle1 %>
            <br />
            <hr />
            <%=RedHouse.Web.Resources.lblHomeCaption1 %>
            <hr />
            <br />
            <button class="button btn-cart">
                <a href="DishList.aspx?page=Specialties"><span><span>Specialties</span></span></a></button>
            &nbsp;&nbsp;&nbsp;
            <button class="button btn-cart">
                <a href="Menu.aspx"><span><span>Menu</span></span></a></button>
        </div>
    
        <div id="cap2" class="nivo-html-caption">
            <%=RedHouse.Web.Resources.lblHomeTitle2 %>
            <br />
            <hr />
            <%=RedHouse.Web.Resources.lblHomeCaption2 %>
            <hr />
            <br />
            <button class="button btn-cart">
                <a href="DishList.aspx?page=Specialties"><span><span>Specialties</span></span></a></button>
            &nbsp;&nbsp;&nbsp;
            <button class="button btn-cart">
                <a href="Menu.aspx"><span><span>Menu</span></span></a></button>
        </div>

        <div id="cap3" class="nivo-html-caption">
            <%=RedHouse.Web.Resources.lblHomeTitle3 %>
            <br />
            <hr />
            <%=RedHouse.Web.Resources.lblHomeCaption3 %>
            <hr />
            <br />
            <button class="button btn-cart">
                <a href="DishList.aspx?page=Specialties"><span><span>Specialties</span></span></a></button>
            &nbsp;&nbsp;&nbsp;
            <button class="button btn-cart">
                <a href="Menu.aspx"><span><span>Menu</span></span></a></button>
        </div>

        <div id="cap4" class="nivo-html-caption">
            <%=RedHouse.Web.Resources.lblHomeTitle4 %>
            <br />
            <hr />
            <%=RedHouse.Web.Resources.lblHomeCaption4 %>
            <hr />
            <br />
            <button class="button btn-cart">
                <a href="DishList.aspx?page=Specialties"><span><span>Specialties</span></span></a></button>
            &nbsp;&nbsp;&nbsp;
            <button class="button btn-cart">
                <a href="Menu.aspx"><span><span>Menu</span></span></a></button>
        </div>
    <%
       } %>
    <% else
       { %>
        <div id="slider" class="nivoSlider">
            <%--<img class="home-slide" src="http://redhouse.com.vn/picture_library/promotion/dauhu.jpg" rel="picture_library/promotion/dauhu-thumb.jpg" title="#cap6" />--%>
            <%--<img class="home-slide" src="http://redhouse.com.vn/picture_library/promotion/xmas-hcm.jpg" rel="http://redhouse.com.vn/picture_library/promotion/xmas-hcm-thumb.jpg" title="#cap7" />--%>
            <img class="home-slide" src="http://redhouse.com.vn/picture_library/cua_xot_ot/2.jpg" rel="images/home-1_thumb.png" title="#cap1" />
            <img class="home-slide" src="http://redhouse.com.vn/picture_library/cua_xot_tieu_den/3.jpg" rel="images/home-2_thumb.png" title="#cap2" />
            <img class="home-slide" src="http://redhouse.com.vn/picture_library/oc_mong_tay/3.jpg" rel="images/home-3_thumb.png" title="#cap3" />
            <img class="home-slide" src="http://redhouse.com.vn/picture_library/dau_hu_tay_cam/1.jpg" rel="images/home-4_thumb.png" title="#cap4" />
        </div>

        <div id="cap7" class="nivo-html-caption">
            <%=RedHouse.Web.Resources.lblHomeTitle8 %>
            <br />
            <hr />
            <%=RedHouse.Web.Resources.lblHomeCaption8 %>
            <hr />
            <br />
            <button class="button btn-cart">
                <a href="DishList.aspx?page=Specialties"><span><span>Specialties</span></span></a></button>
            &nbsp;&nbsp;&nbsp;
            <button class="button btn-cart">
                <a href="Menu.aspx"><span><span>Menu</span></span></a></button>
        </div>

        <%--<div id="cap6" class="nivo-html-caption">
            <%=RedHouse.Web.Resources.lblHomeTitle6 %>
            <br />
            <hr />
            <%=RedHouse.Web.Resources.lblHomeCaption6 %>
            <hr />
            <br />
            <button class="button btn-cart">
                <a href="DishList.aspx?page=Specialties"><span><span>Specialties</span></span></a></button>
            &nbsp;&nbsp;&nbsp;
            <button class="button btn-cart">
                <a href="Menu.aspx"><span><span>Menu</span></span></a></button>
        </div>--%>

        <div id="cap1" class="nivo-html-caption">
            <%=RedHouse.Web.Resources.lblHomeTitle1 %>
            <br />
            <hr />
            <%=RedHouse.Web.Resources.lblHomeCaption1 %>
            <hr />
            <br />
            <button class="button btn-cart">
                <a href="DishList.aspx?page=Specialties"><span><span>Specialties</span></span></a></button>
            &nbsp;&nbsp;&nbsp;
            <button class="button btn-cart">
                <a href="Menu.aspx"><span><span>Menu</span></span></a></button>
        </div>
    
        <div id="cap2" class="nivo-html-caption">
            <%=RedHouse.Web.Resources.lblHomeTitle2 %>
            <br />
            <hr />
            <%=RedHouse.Web.Resources.lblHomeCaption2 %>
            <hr />
            <br />
            <button class="button btn-cart">
                <a href="DishList.aspx?page=Specialties"><span><span>Specialties</span></span></a></button>
            &nbsp;&nbsp;&nbsp;
            <button class="button btn-cart">
                <a href="Menu.aspx"><span><span>Menu</span></span></a></button>
        </div>

        <div id="cap3" class="nivo-html-caption">
            <%=RedHouse.Web.Resources.lblHomeTitle3 %>
            <br />
            <hr />
            <%=RedHouse.Web.Resources.lblHomeCaption3 %>
            <hr />
            <br />
            <button class="button btn-cart">
                <a href="DishList.aspx?page=Specialties"><span><span>Specialties</span></span></a></button>
            &nbsp;&nbsp;&nbsp;
            <button class="button btn-cart">
                <a href="Menu.aspx"><span><span>Menu</span></span></a></button>
        </div>

        <div id="cap4" class="nivo-html-caption">
            <%=RedHouse.Web.Resources.lblHomeTitle4 %>
            <br />
            <hr />
            <%=RedHouse.Web.Resources.lblHomeCaption4 %>
            <hr />
            <br />
            <button class="button btn-cart">
                <a href="DishList.aspx?page=Specialties"><span><span>Specialties</span></span></a></button>
            &nbsp;&nbsp;&nbsp;
            <button class="button btn-cart">
                <a href="Menu.aspx"><span><span>Menu</span></span></a></button>
        </div>
    <%
       } %>
</asp:Content>